#include"BinaryTree.h"

TreeNode* BinaryTree_Int(char* arr[], int size)
{
    TreeNode* root = NULL;
    if(size)
    {
        root = malloc(sizeof(TreeNode));
        root->left = NULL; root->right = NULL;
        constructor_Int(root,arr,size,0);
    }
    return root;
}
void constructor_Int(TreeNode* node, char* arr[], int size, int i)
{
    // 利用根-子节点坐标的位置关系完成
    sscanf(arr[i],"%d",&(node->val));
    node->left = NULL; node->right = NULL;
    if(2*i + 1 < size) 
    {
        node->left = malloc(sizeof(TreeNode));
        constructor_Int(node->left,arr,size,2*i+1);
    }
    if(2*i + 2 < size) 
    {
        node->right = malloc(sizeof(TreeNode));
        constructor_Int(node->right,arr,size,2*i+2);
    }
}

void _BinaryTree(TreeNode* root)
{

}
